layui.use(['form'], function () {
    var form = layui.form,
        layer = layui.layer,
        $ = layui.$;

    //监听提交
    form.on('submit(saveBtn)', function (data) {
        var index = layer.alert(JSON.stringify(data.field), {
            title: '最终的提交信息'
        }, function () {

            // 关闭弹出层
            layer.close(index);

            var iframeIndex = parent.layer.getFrameIndex(window.name);
            parent.layer.close(iframeIndex);

        });

        return false;
    });

});

function GetQueryString(name) {
    let reg = new RegExp("(^|&)"+name+"=([^&]*)(&|$)");
    let r = window.location.search.substr(1).match(reg);
    if (r!=null){
        return decodeURI(r[2]);
    }
    return null;
}
var rule_uid = GetQueryString("id");

function init(){
    $.ajax({
        url:"/MappingRules/view",
        type:"Get",
        data:"ruleuid=" + rule_uid,
        datatype:"json",
        async:false,
        success:(res)=>{
            console.log("Debug map view:",res);
        }
    });
}